#ifndef MAIN_H
  #define MAIN_H

//#define F_CPU 10000000UL
#define blinktakt 25		// Blinkgeschwindigkeit Shift kann hier eingestellt werden
// Externe Header
#include <stdio.h>
#include <avr/io.h>
#include <avr/iom32.h>
#include <avr/interrupt.h>
#include <util/delay.h>

//Interne Header
#include "keys.h"
#include "debounce.h"
#include "myrfm12/myrfm12conf.h"
#include "myrfm12/myrfm12.h"

//Pin Belegung

// RFM-Modul FFIT Pin
#define RFM_FFIT_PORT PORTB
#define RFM_FFIT_DDR  DDRB
#define RFM_FFIT_PIN  1

// RFM-Modul FSK Pin
#define RFM_FSK_PORT PORTB
#define RFM_FSK_DDR  DDRB
#define RFM_FSK_PIN  0

// RFM-Modul VDI Pin
#define RFM_VDI_PORT PORTD
#define RFM_VDI_DDR  DDRD
#define RFM_VDI_PIN  3

// Status-LED red
#define LED_STATUS_PORT PORTA
#define LED_STATUS_DDR  DDRA
#define LED_STATUS_PIN  3

// OFF-Pin
#define OFF_PORT PORTC
#define OFF_DDR  DDRC
#define OFF_PIN  5

// Matrix-Tastatur
#define KEY_PORT PORTC
#define KEY_DDR  DDRC
#define KEY_PIN	 PINC
#define KEY_PIN1  7
#define KEY_PIN2  6
#define KEY_PIN5  4
#define KEY_PIN6  3
#define KEY_PIN7  2
#define KEY_PIN8  1
#define KEY_PIN9  0

//Funktionsprototyp
int main(void);
void init_ports(void);
void waitms(uint16_t ms);
void init_timer0();
void init_timer1();

// Externe Variablen
extern volatile uint8_t eingabe;
extern volatile uint8_t newkey, shift;

#endif
